#include <iostream>
#include <string>


using namespace std;

int main()

{

	string s("words and 987");
	size_t sz;
	int i = stoi(s, &sz);
	cout << i << endl;
	cout << sz << endl;

	return 0;
}